package com.open.base.model;

import java.io.Serializable;
import java.util.List;

public class LoginUser implements Serializable {

    private static final long serialVersionUID = 382904889113423097L;

    public LoginUser(){}

    public LoginUser(Role role, List<Menu> menus, List<Role> roles, User user) {
        this.role = role;
        this.permissions = menus;
        this.roles = roles;
        this.user = user;
    }

    public LoginUser(String token, Long loginTime, Long expireTime, Role role, List<Menu> menus, List<Role> roles, User user) {
        this.token = token;
        this.loginTime = loginTime;
        this.expireTime = expireTime;
        this.role = role;
        this.permissions = menus;
        this.roles = roles;
        this.user = user;
    }

    //用户唯一标识
    private String token;

    //登录时间
    private Long loginTime;

    //过期时间
    private Long expireTime;

    //当前角色
    private Role role;

    // 权限列表
    private List<Menu> permissions;

    // 角色列表
    List<Role> roles;

    //用户信息
    private User user;

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public Long getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(Long loginTime) {
        this.loginTime = loginTime;
    }

    public Long getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(Long expireTime) {
        this.expireTime = expireTime;
    }

    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    public List<Menu> getPermissions() {
        return permissions;
    }

    public void setPermissions(List<Menu> menus) {
        this.permissions = menus;
    }

    public List<Role> getRoles() {
        return roles;
    }

    public void setRoles(List<Role> roles) {
        this.roles = roles;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @Override
    public String toString() {
        return "LoginUser{" +
                "token='" + token + '\'' +
                ", loginTime=" + loginTime +
                ", expireTime=" + expireTime +
                ", role=" + role +
                ", permissions=" + permissions +
                ", roles=" + roles +
                ", user=" + user +
                '}';
    }
}